import { createRouter, createWebHashHistory } from 'vue-router'
import routerConfig from '@/router/config';
import mainIndex from '@/view/main/index.vue';

let router = null;

const routes = [
  {
    path: '/',
    component: mainIndex,
    children: routerConfig
  }
];
export const setupRouter = (app) => {
  router = createRouter({
    history: createWebHashHistory(`/#/allInfo`),
    strict: true,
    routes: routes,
    scrollBehavior: () => ({ left: 0, top: 0 })
  });

  router.afterEach((to) => {
    // NProgress.done();
  });

  app.use(router);
};